package com.fivefu.core.hik.controller;

import com.fivefu.base.web.controller.BaseController;
import com.fivefu.base.web.vo.ResultInfo;
import com.fivefu.core.hik.services.TreeService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 海康树结构 前端控制器
 * </p>
 *
 * @author 
 * @since 2022-09-01 16:32:36
 */
@RestController
@RequestMapping("/db-hik-tree")
public class DbHikTreeController extends BaseController {

    private Logger logger = LoggerFactory.getLogger(DbHikTreeController.class);

    @Autowired
    private TreeService treeService;

    @ApiOperation(value = "获取树结构",httpMethod = "GET",response = ResultInfo.class,notes = "获取树结构")
    @RequestMapping(path = "getHikTreeList",method = RequestMethod.GET)
    public ResultInfo getHikTreeList(){
        try {
            treeService.getHikTreeList();
            return ResultInfo.renderSuccess("获取树结构成功");
        } catch (Exception e){
            logger.error(e.getMessage(),e);
        }
        return ResultInfo.renderError("获取树结构失败");
    }

}
